#include <stdlib.h>
#include <malloc.h>
#include "BTree.cpp"

int main(void)
{
    BTNode *b = NULL;
    char tree[50] = "(A(B(D,E(H(J,K(L,M(,N))))),C(F,G(,I)))";
    char *str = tree;

    printf("该二叉树的括号表示方法为：\n");
    CreateBTree(b, str);
    DispBTree(b);
    printf("\n");

    BTNode *p = FindNode(b, 'H');
    printf("H节点左孩子的值为:%c\nH节点右孩子的值为:%c", p->lchild->value, p->rchild->value);

    int height = BTHeight(b);
    printf("该二叉树的高度为:%d\n", height);

    DestoryBTree(b);
}